<template>
  <Form ref="form" :model="formItem" :rules="formItemRules" :label-width="135">
    <FormItem label="custom" prop="a">
      <Input v-model="formItem.a" placeholder="请输入内容"> </Input>
    </FormItem>
  </Form>
</template>
<script>
export default {
  name: '',
  data() {
    return {
      formItem: {
        a: 'customData'
      },
      formItemRules: {
        a: [{ required: true, message: '不能为空' }]
      }
    };
  },
  methods: {
    async getData() {
      const valid = await this.$refs.form.validate();
      if (valid) {
        return this.formItem;
      } else {
        return false;
      }
    },
    setData(data) {
      this.formItem = data;
    }
  }
};
</script>
